<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="6"
        ><div class="grid-content bg-purple one">
          <p>工作进度</p>
          <div class="bottom">
            <div class="bleft">
              <li>
                <div class="mask"></div>
                <span>已完成</span>
              </li>
              <li>
                <div class="mask mask1"></div>
                <span>未完成</span>
              </li>
            </div>
            <div class="bmidden">
              <el-progress
                type="dashboard"
                :percentage="75"
                width="81"
                status="warning"
                :indeterminate="true"
              >
                <template #default="{ percentage }">
                  <span class="percentage-value">{{ percentage }}%</span>
                </template>
              </el-progress>
            </div>
            <div class="brigth">
              <p>查看</p>
            </div>
          </div>
        </div></el-col
      >
      <el-col :span="6"
        ><div class="grid-content bg-purple two">
          <div class="left">
            <img src="@/assets/img/19.png" alt="" />
          </div>
          <div class="right">
            <p>总收款额:230000/元</p>
            <p>总营业额:200986/元</p>
            <p>退款总额:29014/元</p>
          </div>
        </div></el-col
      >
      <el-col :span="6"
        ><div class="grid-content bg-purple three">
          <div class="left">
            <img src="@/assets/img/20.png" alt="" />
          </div>
          <div class="right">
            <p>周成交单:146单</p>
            <p>月成交单:840单</p>
            <p>退款总单:54单</p>
          </div>
        </div></el-col
      >
      <el-col :span="6"
        ><div class="grid-content bg-purple four">
          <div class="left">
            <img src="@/assets/img/21.png" alt="" />
          </div>
          <div class="right">
            <p>本周新增:138人</p>
            <p>学员总数:27600人</p>
            <p>申请退款:102人</p>
          </div>
        </div></el-col
      >
    </el-row>
    <el-row :gutter="20">
      <el-col :span="6">
        <div class="grid-content1 bg-purple five">
          <p>明星教师</p>
          <li
            v-for="(item, index) in 3"
            :key="index"
            :class="{ active: +index % 2 == 1 }"
          >
            <div class="midden">
              <div class="leftimg">
                <img src="@/assets/img/明星教师图片.png" alt="" />
              </div>
              <div class="right">
                <h2>李苗苗</h2>
                <p>国内知名日系插画师 绘世界金牌老师，十 年教学经验。</p>
              </div>
            </div>
            <div class="bottom">
              <a href="">查看详情</a>
            </div>
          </li>
        </div>
      </el-col>
      <el-col :span="12">
        <div class="grid-content1 bg-purple">
          <div class="six">
            <div class="title">
              <h2>待办任务</h2>
              <span>您有{{ myhomelist.length }}条待办任务未完成</span>
              <a href="">更多</a>
            </div>
            <ul>
              <li
                v-for="(item, index) in myhomelist"
                :key="index"
                :class="{ active: index % 2 == 1 }"
              >
                <img src="@/assets/img/未处理信封.png" alt="" />
                <p>
                  处理来自{{ item.name }}{{ item.cname }}的{{
                    item.pros
                  }}信息，请尽快查收。
                </p>
                <span>{{ item.mtime }}</span>
              </li>
            </ul>
          </div>
        </div>
      </el-col>
      <el-col :span="6">
        <div class="grid-content1 bg-purple">
          <div class="seven">
            <div class="title">
              <h2>热门课程</h2>
              <span>更多</span>
            </div>
            <div v-for="(item, index) in 2" :key="index">
              <div class="imgbox">
                <img src="@/assets/img/日系插画图片.png" alt="" />
              </div>
              <div class="btitle">
                <h2>精品日系风格插画班</h2>
                <span>编辑管理</span>
              </div>
              <p>主讲老师</p>
              <div class="bottom">
                <div class="img"></div>
                <div class="biaoti">
                  <h2>李苗苗</h2>
                  <p>国内知名日系画师，曾就读于于日本……</p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mockapi } from "../../../api/myhome/mock";
export default {
  data() {
    return {
      active: true,
      myhomelist: "",
    };
  },
  created() {
    this.getmyhomeapi();
  },
  methods: {
    async getmyhomeapi() {
      const res = await mockapi.getmyhomelist();
      console.log(res);
      this.myhomelist = res.result.data;
    },
  },
};
</script>

<style lang="less" scoped>
.el-row {
  margin-bottom: 10px;
  &:last-child {
    margin-bottom: 0;
  }
}
.bg-purple {
  background: #d3dce6;
}
.grid-content {
  border-radius: 4px;
  min-height: 160px;
  padding: 9px 13px;
}
.grid-content1 {
  border-radius: 4px;
  height: 468px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.five {
  > p {
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    color: #333333;
    line-height: 27px;
    height: 27px;
    padding: 0 13px;
    background: #fff;
  }
  .active {
    background: #fff;
  }
  li {
    width: 100%;
    height: 151px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    padding: 0 20px;

    .midden {
      display: flex;
      margin-top: 30px;
      .leftimg {
        width: 53px;
        height: 53px;
        border-radius: 50%;
        img {
          width: 100%;
          height: 100%;
        }
      }
      .right {
        width: 128px;
        height: 53px;
        display: flex;
        flex-direction: column;
        margin-left: 20px;
        h2 {
          width: 100%;
          font-size: 11px;
          font-family: PingFang SC;
          font-weight: 800;
          color: #333333;
          margin-bottom: 5px;
        }
        p {
          width: 100%;
          height: 39px;
          font-size: 9px;
          font-weight: 400;
          color: #666666;
          line-height: 15px;
        }
      }
    }
    .bottom {
      margin-top: 40px;
      display: flex;
      justify-content: flex-end;
      a {
        color: #446ce3;
        font-weight: 800;
      }
    }
  }
}
.one {
  display: flex;
  flex-direction: column;
  background: #fff;
  > p {
    height: 27px;
    font-size: 14px;
    font-family: PingFang SC;
    font-weight: 400;
    color: #333333;
    line-height: 27px;
    border-bottom: 0.5px solid #e9e9e9;
  }
  .bottom {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    .bleft {
      display: flex;
      flex: 1;
      height: 115px;
      flex-direction: column;
      justify-content: center;
      li {
        width: 100%;
        height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        .mask {
          width: 13px;
          height: 13px;
          background: #92acf0;
          border-radius: 7px;
        }
        .mask1 {
          background: orange;
        }
      }
    }
    .bmidden {
      width: 81px;
      height: 81px;
      flex: 1;
    }
    .brigth {
      height: 115px;
      display: flex;
      justify-content: flex-end;
      flex-direction: column;
      p {
        text-align: right;
      }
    }
  }
}
.two,
.three,
.four {
  display: flex;
  background: url("../../../assets/img/blue.png") no-repeat;
  align-items: center;
  justify-content: space-around;
  background-size: 100% 100%;
  .left {
    width: 75px;
    height: 75px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .right {
    width: 130px;
    height: 75px;
    p {
      font-size: 11px;
      font-family: PingFang SC;
      font-weight: 400;
      color: #ffffff;
      line-height: 27px;
    }
  }
}
.three {
  background: url("../../../assets/img/green.png") no-repeat;
  background-size: 100% 100%;
}
.four {
  background: url("../../../assets/img/orange.png") no-repeat;
  background-size: 100% 100%;
}
.six {
  padding: 0 10px;
  background: #fff;
  height: 485px;
  .title {
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #e9e9e9;
    justify-content: space-between;
    h2 {
      font-size: 16px;
    }
    span {
      color: #ff0000;
    }
    a {
      color: #446ce3;
    }
  }
  ul {
    margin-top: 10px;
    li {
      width: 100%;
      height: 50px;
      background: #f5f5f5;
      display: flex;
      padding: 0 10px;
      justify-content: space-between;
      align-items: center;
      img {
        width: 20px;
        height: 18px;
      }
    }
    .active {
      background: #fff;
    }
  }
}
.seven {
  padding: 0 20px;
  background: #fff;
  overflow: auto;
  height: 485px;
  .title {
    display: flex;
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid #e9e9e9;
    height: 30px;
    align-items: center;
    span {
      color: #446ce3;
    }
  }
  .imgbox {
    width: 100%;
    height: 150px;
    margin-top: 20px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .btitle {
    width: 100%;
    height: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    span {
      color: #446ce3;
    }
  }
  p {
    height: 16px;
    font-size: 12px;
  }
  .bottom {
    width: 100%;
    display: flex;
    margin-top: 10px;
    .img {
      width: 40px;
      height: 40px;
      background: #92acf0;
      border-radius: 50%;
    }
    .biaoti {
      width: 257px;
      height: 40px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }
  }
}
</style>
